<?php
  $yhendus=new mysqli("localhost", "if13", "ifikad", "if13_meimanma_e");
  $kask=$yhendus->prepare("SELECT id, nimi, varv FROM kassid");
  $kask->bind_result($id, $nimi, $varv);
  $kask->execute();
?>
<!doctype html>
<html>
  <head>
     <title>Teated lehel</title>
  </head>
  <body>
     <h1>Teadete loetelu</h1>
     <?php
       while($kask->fetch()){
         echo "<h2>".htmlspecialchars($nimi)."</h2>";
         echo "<div>".htmlspecialchars($varv)."</div>";
       }
     ?>
  </body>
</html>
<?php
  $yhendus->close();
?>